/*  1:   */ package org.intellij.images.actions;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.intellij.images.thumbnail.ThumbnailManager;
import org.intellij.images.thumbnail.ThumbnailView;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */ 
/* 12:   */ public final class ShowThumbnailsAction
/* 13:   */   extends AnAction
/* 14:   */ {
/* 15:   */   public void actionPerformed(AnActionEvent paramAnActionEvent)
/* 16:   */   {
/* 17:35 */     Project localProject = (Project)paramAnActionEvent.getData(CommonDataKeys.PROJECT);
/* 18:36 */     VirtualFile localVirtualFile = (VirtualFile)paramAnActionEvent.getData(CommonDataKeys.VIRTUAL_FILE);
/* 19:37 */     if ((localProject != null) && (localVirtualFile != null) && (localVirtualFile.isDirectory()))
/* 20:   */     {
/* 21:38 */       ThumbnailManager localThumbnailManager = ThumbnailManager.getManager(localProject);
/* 22:39 */       ThumbnailView localThumbnailView = localThumbnailManager.getThumbnailView();
/* 23:40 */       localThumbnailView.setRoot(localVirtualFile);
/* 24:41 */       localThumbnailView.setVisible(true);
/* 25:42 */       localThumbnailView.activate();
/* 26:   */     }
/* 27:   */   }
/* 28:   */   
/* 29:   */   public void update(AnActionEvent paramAnActionEvent)
/* 30:   */   {
/* 31:47 */     super.update(paramAnActionEvent);
/* 32:48 */     VirtualFile localVirtualFile = (VirtualFile)paramAnActionEvent.getData(CommonDataKeys.VIRTUAL_FILE);
/* 33:49 */     boolean bool = (localVirtualFile != null) && (localVirtualFile.isDirectory());
/* 34:50 */     if (paramAnActionEvent.getPlace().equals("ProjectViewPopup")) {
/* 35:51 */       paramAnActionEvent.getPresentation().setVisible(bool);
/* 36:   */     } else {
/* 37:54 */       paramAnActionEvent.getPresentation().setEnabled(bool);
/* 38:   */     }
/* 39:   */   }
/* 40:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.actions.ShowThumbnailsAction

 * JD-Core Version:    0.7.0.1

 */